﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLBH.ModelInterface;
using QLBH.DataModel;

namespace QLBH.FeatureModel
{
    public class LichSuThuNoModel:ILichSuThuNoModel
    {
        private Guid id;
        private Guid sonoid;
        private decimal sotien;
        private String ghichu;
        private DateTime ngaytao;
        private Guid userid;        
        public Guid ID
        {
            get
            {
                return id;
            }
            set
            {
                id = value;
            }
        }

        public Guid SONOID
        {
            get
            {
                return sonoid;
            }
            set
            {
                sonoid = value;
            }
        }

        public decimal SOTIEN
        {
            get
            {
                return sotien;
            }
            set
            {
                sotien = value;
            }
        }

        public string GHICHU
        {
            get
            {
                return ghichu;
            }
            set
            {
                ghichu = value;
            }
        }

        public DateTime NGAYTAO
        {
            get
            {
                return ngaytao;
            }
            set
            {
                ngaytao = value;
            }
        }

        public Guid USERID
        {
            get
            {
                return userid;
            }
            set
            {
                userid = value;
            }
        }
        public void InitFromEntity(DataModel.LICHSUTHUTRANO entity)
        {
            id = entity.ID;
            sonoid = (Guid)entity.SONOID;
            sotien = (decimal)entity.SOTIEN;
            ghichu = entity.GHICHU;
            ngaytao = (DateTime)entity.NGAYTAO;
            userid = (Guid)entity.NGUOITAOID;
        }

        public DataModel.LICHSUTHUTRANO ToEntity()
        {
            LICHSUTHUTRANO entity = new LICHSUTHUTRANO();
            entity.ID = id;
            entity.SONOID = sonoid;
            entity.SOTIEN = sotien;
            entity.GHICHU = ghichu;
            entity.NGAYTAO = ngaytao;
            entity.NGUOITAOID = userid;

            return entity;
        }        
    }
}
